package com.clientmanage.controller;

import com.clientmanage.domain.vo.clientInfoVo;
import com.clientmanage.service.ICustomerService;
import com.clientmanage.domain.resp.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 宠物疫苗记录控制器
 * 实现疫苗记录管理相关接口
 */
@RestController
@RequestMapping("/customer/vaccine")
public class PetVaccineRecordController {

    @Autowired
    private ICustomerService customerService;

    /**
     * 新增疫苗记录
     * 接口地址：POST /customer/vaccine/add
     */
    @PostMapping("/add")
    public Result<Void> addVaccine(@RequestBody clientInfoVo vo) {
        customerService.addVaccine(vo);
        return Result.success();
    }

    /**
     * 更新疫苗记录
     * 接口地址：PUT /customer/vaccine/update
     */
    @PutMapping("/update")
    public Result<Void> updateVaccine(@RequestBody clientInfoVo vo) {
        customerService.updateVaccine(vo);
        return Result.success();
    }

    /**
     * 删除疫苗记录
     * 接口地址：DELETE /customer/vaccine/delete/{id}
     */
    @DeleteMapping("/delete/{id}")
    public Result<Void> deleteVaccine(@PathVariable String id) {
        customerService.deleteVaccineById(id);
        return Result.success();
    }
}
